Matthias Clasen [Fri, 11 Sep 2015 02:02:03 +0000 (22:02 -0400)]
css lookup: Replace g_return by gtk_internal return
These functions are called in an inner loop in
gtk_css_style_provider_lookup.
Matthias Clasen [Fri, 11 Sep 2015 00:42:58 +0000 (20:42 -0400)]
css selector: Use a builtin to count bits
Matthias Clasen [Fri, 11 Sep 2015 00:42:07 +0000 (20:42 -0400)]
css matcher: Avoid a redundant call
The sole caller passes an interned string, so we don't
need to call g_intern_string again.
Matthias Clasen [Fri, 11 Sep 2015 00:04:24 +0000 (20:04 -0400)]
css selector: Take advantage of interned strings
We know these strings are interned, no need to use strcmp or
g_str_hash for hem.
Matthias Clasen [Fri, 11 Sep 2015 13:06:46 +0000 (09:06 -0400)]
bitmask: Trivial formatting fix
Matthias Clasen [Thu, 10 Sep 2015 22:48:29 +0000 (18:48 -0400)]
bitmask: Optimize no-op resizes
Statistics for the gtk3-demo listbox example show that the
vast majority of calls to _gtk_allocated_bitmask_resize go
from a size of 2 to 2. Don't needlessly call realloc() in
this case.
Matthias Clasen [Thu, 10 Sep 2015 22:46:58 +0000 (18:46 -0400)]
bitmask: Optimize intersect
The functions was written in a way that would possibly
resize the mask twice, which is not necessary.
Matthias Clasen [Wed, 9 Sep 2015 21:32:47 +0000 (17:32 -0400)]
widget-factory: Simplify the ui file
Matthias Clasen [Wed, 9 Sep 2015 21:34:32 +0000 (17:34 -0400)]
gtk-demo: Simplify ui files
Matthias Clasen [Wed, 9 Sep 2015 20:50:49 +0000 (16:50 -0400)]
Run gtk-builder-tool simplify over all templates
Matthias Clasen [Wed, 9 Sep 2015 20:47:02 +0000 (16:47 -0400)]
gtk-builder-tool: Canonicalize booleans
Always write booleans as '0' or '1'.
Matthias Clasen [Wed, 9 Sep 2015 20:52:11 +0000 (16:52 -0400)]
builder: Minor tweak
Benjamin Otte [Sat, 12 Sep 2015 00:59:38 +0000 (02:59 +0200)]
widgetpath: Implement using GtkCssNodeDeclaration
This removes a bunch of code but more importantly allows providing the
declaration in CSS matchers.
Benjamin Otte [Sat, 12 Sep 2015 00:58:28 +0000 (02:58 +0200)]
cssnode: Move clear_classes() into the NodeDeclaration
The previous code was crashing when used as the returned classes array
would have been invalid after the first deletion. So if a 2nd class
would be deleted, invalid memory might have been referenced.
Garrett Regier [Fri, 11 Sep 2015 16:46:34 +0000 (09:46 -0700)]
stylecontext: Fix list_classes() after optimization
Otherwise a junk value is returned.
Garrett Regier [Fri, 11 Sep 2015 16:45:32 +0000 (09:45 -0700)]
widgetpath: Remove bad function prototypes
Benjamin Otte [Fri, 11 Sep 2015 16:33:05 +0000 (18:33 +0200)]
iconcache: Guard deprecated gdk-pixbuf APIs
Garrett Regier [Fri, 11 Sep 2015 15:49:59 +0000 (17:49 +0200)]
cssnode: Optimize listing of classes
Avoid creating the GList of strings when the GQuarks
will just be determined again. Instead have
gtk_style_context_list_classes() do it specifically.
Garrett Regier [Fri, 11 Sep 2015 14:13:45 +0000 (16:13 +0200)]
container: Don't add classes twice
_gtk_widget_create_path() already adds the style classes.
Alberts Muktupāvels [Fri, 11 Sep 2015 09:49:51 +0000 (12:49 +0300)]
gtkplug.c: remove draw function, not needed
Background will be rendered by parent class - GtkWindow.
https://bugzilla.gnome.org/show_bug.cgi?id=754854
Michael Weghorn [Thu, 13 Aug 2015 20:31:28 +0000 (22:31 +0200)]
Improve printer distinction for option retrieval
In order to retrieve the user options for a printer, the respective
printer name is used.
This fixes the comparison of printer names to avoid that the options of
another printer are accidently read whose name starts with the same
letters, but is longer (e.g. "myprinterlongername" instead of
"myprinter").
This fixes Bug 753628.
Jakub Steiner [Fri, 11 Sep 2015 10:39:08 +0000 (12:39 +0200)]
HighContrast: make sidebar list rows taller
sync with Adwaita
https://bugzilla.gnome.org/show_bug.cgi?id=754866
Ross Lagerwall [Tue, 8 Sep 2015 22:12:54 +0000 (23:12 +0100)]
GtkFileSystem: Add to the list of remote filesystems
Add afp and google-drive to the list of remote filesystems.
https://bugzilla.gnome.org/show_bug.cgi?id=754746
Dušan Kazik [Thu, 10 Sep 2015 16:26:56 +0000 (16:26 +0000)]
Updated Slovak translation
Timm Bäder [Thu, 10 Sep 2015 09:47:34 +0000 (11:47 +0200)]
GtkWidget: Fix typo in #ifdef
It's ENABLE, not ENABEL. Also fix the corresponding #endif comments.
Timm Bäder [Thu, 10 Sep 2015 09:34:44 +0000 (11:34 +0200)]
GtkContainer: Fix paramter name in doc comment
Matthias Clasen [Wed, 9 Sep 2015 18:40:36 +0000 (14:40 -0400)]
Optimize gtk_css_node_declaration_has_class
This function is getting called a lot. Statistics for the gtk3-demo
listbox example show most calls with 0-4 classes. Unrolling the cases
a bit brings the instruction count in callgrind from 93M to 52M.
Matthias Clasen [Wed, 9 Sep 2015 18:09:21 +0000 (14:09 -0400)]
More bit manipulation speedups
The same trick that was applied to _gtk_css_change_for_child in
the previous commit can be applied to _gtk_css_change_for_sibling
as well, and that is what this commit does.
With both functions converted, gtk_css_change_translate is no
longer needed and gets dropped.
Matthias Clasen [Wed, 9 Sep 2015 18:00:49 +0000 (14:00 -0400)]
Manipulate bits more efficiently
The function to translate GtkCssChange enum values to the PARENT
ones is called very frequently. This patch speeds it up tremendously.
The callgrind instruction count for this function in the listbox
demo goes from 108M to 7M.
Matthias Clasen [Wed, 9 Sep 2015 15:08:43 +0000 (11:08 -0400)]
match_all: Only allocate an array when needed
My statistics show that more than half of all calls end up
with 0 matches, so we can avoid some overhead by not allocating
an array at all in this case.
Matthias Clasen [Wed, 9 Sep 2015 14:55:31 +0000 (10:55 -0400)]
Handle match_all returning NULL
This is in preparation for not allocating an array at all if there
are no matches.
Matthias Clasen [Wed, 9 Sep 2015 14:46:48 +0000 (10:46 -0400)]
Optimize gtk_css_selector_match_all
We are dealing with really short lists here.
95% are < 10 matches, and the longest I've been able to record was 19.
So just do away with the hash table and do sorted insertion in
the array directly.
Carlos Garnacho [Wed, 9 Sep 2015 14:05:15 +0000 (16:05 +0200)]
x11: Declare variable for the inner loop
Otherwise the outer loop control variable is messed up, and we end
up with uninitialized axes if there were any more valuators after
the XIKeyClass one.
This bug was sneakily introduced by
fdb9a8e14, many thanks to
Carlos Soriano for helping spot the source of this bug.
https://bugzilla.gnome.org/show_bug.cgi?id=753431
Lapo Calamandrei [Tue, 8 Sep 2015 18:10:51 +0000 (20:10 +0200)]
Adwaita: special case selection mode lists checks
...otherwise the special selection mode 40x40px checks are used
shrinked to 16x16.
See https://bugzilla.gnome.org/show_bug.cgi?id=754610
Matthias Clasen [Wed, 9 Sep 2015 14:20:07 +0000 (10:20 -0400)]
Update the gtk3-demo man page
We have options now !
Matthias Clasen [Wed, 9 Sep 2015 14:14:17 +0000 (10:14 -0400)]
gtk-demo:Add a --list option
This just shows the available examples and then exists.
Matthias Clasen [Wed, 9 Sep 2015 12:07:20 +0000 (08:07 -0400)]
gtk-demo: Make --autoquit a simple option
No real need to specify the amount of delay, just make this
a plain boolean.
Matthias Clasen [Wed, 9 Sep 2015 04:51:45 +0000 (00:51 -0400)]
Use G_ENABLE_CONSISTENCY_CHECKS for template finalization checks
Matthias Clasen [Wed, 9 Sep 2015 04:38:48 +0000 (00:38 -0400)]
css selector: Use the quarks we have
Unless I'm missing something, there is no reason to go from
quarks back to strings to implement hasing or comparison.
Matthias Clasen [Wed, 9 Sep 2015 03:21:17 +0000 (23:21 -0400)]
style provider private: Use gtk_internal_return_if_fail
Matthias Clasen [Wed, 9 Sep 2015 02:48:44 +0000 (22:48 -0400)]
Clean up debug features
Introduce a GTK_DEBUG_CHECK() macro and use it to check for
GTK_DEBUG flags everywhere. Also guard all such places by
Matthias Clasen [Wed, 9 Sep 2015 01:08:20 +0000 (21:08 -0400)]
widget: Use G_ENABLE_CONSISTENCY_CHECKS for invariants checking
The logic here is that G_ENABLE_DEBUG is for compiling out
debug spew that can be triggered at runtime with the GTK_DEBUG
environment variable, while G_ENABLE_CONSISTENCY_CHECKS is for
consistency checks that are applied unconditionally.
Matthias Clasen [Wed, 9 Sep 2015 01:06:38 +0000 (21:06 -0400)]
size request: Redo the recursion checks
Use G_ENABLE_CONSISTENCY checks for the recursion checks
in gtksizerequest.c
Matthias Clasen [Wed, 9 Sep 2015 01:20:00 +0000 (21:20 -0400)]
Introduce G_ENABLE_CONSISTENCY_CHECKS
Use a separate G_ENABLE_CONSISTENCY_CHECKS define to guard internal
consistency checks that are applied unconditionally if they are enabled,
such as the widget invariants checking. Interactive debug spew that can
be triggered at runtime with the GTK_DEBUG environment variable is still
guarded by the G_ENABLE_DEBUG define.
The mapping from enable-debug levels to defines is as follows:
yes: G_ENABLE_DEBUG G_ENABLE_CONSISTENCY_CHECKS
minimum: G_ENABLE_DEBUG G_DISABLE_CAST_CHECKS
no: G_DISABLE_CAST_CHECKS G_DISABLE_ASSERT G_DISABLE_CHECKS
Matthias Clasen [Wed, 9 Sep 2015 00:55:32 +0000 (20:55 -0400)]
notebook: Drop use of G_DISABLE_CHECKS
Rewrite the one check that the G_DISABLE_CHECKS macro was used for
in terms of g_return_if_fail.
Matthias Clasen [Wed, 9 Sep 2015 00:39:52 +0000 (20:39 -0400)]
Drop an unused warning
It has been ifzeroed for many, many years.
Matthias Clasen [Wed, 9 Sep 2015 00:30:22 +0000 (20:30 -0400)]
Use a getter for widget direction
Matthias Clasen [Wed, 9 Sep 2015 00:27:50 +0000 (20:27 -0400)]
settings: Reuse a value
We've already gotten the value type, use it.
Matthias Clasen [Wed, 9 Sep 2015 00:24:29 +0000 (20:24 -0400)]
builder: Avoid some type-checking overhead
Matthias Clasen [Tue, 8 Sep 2015 23:29:32 +0000 (19:29 -0400)]
settings: Avoid a redundant check
g_value_transform already returns whether it was successful
or not, so no need to call g_value_type_transformable beforehand.
Claude Paroz [Wed, 9 Sep 2015 07:21:55 +0000 (09:21 +0200)]
Updated po-properties French translation
Lapo Calamandrei [Tue, 8 Sep 2015 20:12:12 +0000 (22:12 +0200)]
Adwaita: set -GtkRange-trough-border: 0 for scrollbars
which fixes firefox scrollbar not being fittsy when maximixed.
Jakub Steiner [Tue, 8 Sep 2015 15:22:10 +0000 (17:22 +0200)]
HighContrast: remove edge highlight
https://bugzilla.gnome.org/show_bug.cgi?id=754551
Matthias Clasen [Tue, 8 Sep 2015 12:07:05 +0000 (08:07 -0400)]
widget path: Use gtk_internal_return_if_fail
Matthias Clasen [Tue, 8 Sep 2015 12:06:17 +0000 (08:06 -0400)]
css style property: Use gtk_internal_return_if_fail
Matthias Clasen [Tue, 8 Sep 2015 10:15:12 +0000 (06:15 -0400)]
css color: Use gtk_internal_return_if_fail
Matthias Clasen [Tue, 8 Sep 2015 10:14:38 +0000 (06:14 -0400)]
allocated bitmask: Use gtk_internal_return_if_fail
Matthias Clasen [Tue, 8 Sep 2015 10:14:07 +0000 (06:14 -0400)]
window: Use internal more internal getters
Matthias Clasen [Tue, 8 Sep 2015 10:13:23 +0000 (06:13 -0400)]
Trivial cleanup
Matthias Clasen [Tue, 8 Sep 2015 01:58:34 +0000 (21:58 -0400)]
widget: Use g_param_spec_get_name_quark
Matthias Clasen [Mon, 7 Sep 2015 22:53:25 +0000 (18:53 -0400)]
stack: Convert to gtk_container_child_notify_by_pspec
Matthias Clasen [Mon, 7 Sep 2015 22:53:06 +0000 (18:53 -0400)]
notebook: Convert to g_object_notify_by_pspec
Matthias Clasen [Mon, 7 Sep 2015 22:27:32 +0000 (18:27 -0400)]
grid: Convert to gtk_container_child_notify_by_pspec
For the same reasons as g_object_child_notify_by_pspec.
Matthias Clasen [Mon, 7 Sep 2015 22:27:02 +0000 (18:27 -0400)]
box: Convert to gtk_container_child_notify_by_pspec
For the same reasons as g_object_child_notify_by_pspec.
Matthias Clasen [Mon, 7 Sep 2015 22:10:56 +0000 (18:10 -0400)]
Add some more child property API
Add gtk_container_install_child_properties and
gtk_container_child_notify_by_pspec to mirror te corresponding
GObject APIs.
Matthias Clasen [Mon, 7 Sep 2015 19:55:58 +0000 (15:55 -0400)]
scrolled window: Convert to g_object_notify_by_pspec
Matthias Clasen [Mon, 7 Sep 2015 19:55:34 +0000 (15:55 -0400)]
app chooser button: Convert to g_object_notify_by_pspec
Matthias Clasen [Mon, 7 Sep 2015 19:55:02 +0000 (15:55 -0400)]
settings: Convert more fully to g_object_notify_by_pspec
It turns out that we always have the pspec at hand already.
Kjartan Maraas [Mon, 7 Sep 2015 18:41:48 +0000 (20:41 +0200)]
Updated Norwegian bokmål translation.
Matthias Clasen [Mon, 7 Sep 2015 16:54:16 +0000 (12:54 -0400)]
builder: Simplify _gtk_builder_boolean_from_string
We can do this without calling strlen() or allocating memory.
Matthias Clasen [Mon, 7 Sep 2015 16:43:19 +0000 (12:43 -0400)]
builder: Move a function
Move _gtk_builder_boolean_from_string in the same source file
as the other _from_functions.
Matthias Clasen [Mon, 7 Sep 2015 16:25:29 +0000 (12:25 -0400)]
builder: Minor refactoring
Keep the GString in PropertyInfo around, instead of throwing it
away and just keeping the char*.
Matthias Clasen [Mon, 7 Sep 2015 16:23:09 +0000 (12:23 -0400)]
widget: Add more inline getters
Add a getter for state flags, and use it where appropriate.
Matthias Clasen [Mon, 7 Sep 2015 15:34:41 +0000 (11:34 -0400)]
settings: Avoid one case of g_object_notify
We already have the GParamSpec in hands, lets just use it instead
of looking it up again.
Matthias Clasen [Mon, 7 Sep 2015 15:34:08 +0000 (11:34 -0400)]
Avoid a string copy
We have an api to create a quark from a static string, lets use it.
Benjamin Otte [Sat, 5 Sep 2015 23:13:44 +0000 (01:13 +0200)]
treeview: Donate a priv variable to gtk_tree_view_init()
Benjamin Otte [Sat, 5 Sep 2015 20:36:20 +0000 (22:36 +0200)]
notebook: Don't needlessly cast in macros
That way we disable typechecks done by the compiler and won't notice
when we pass the wrong values to the macro. And that's bad.
Benjamin Otte [Sat, 5 Sep 2015 20:34:37 +0000 (22:34 +0200)]
notebook: Remove unused macros
Benjamin Otte [Sat, 5 Sep 2015 04:46:29 +0000 (06:46 +0200)]
stylecontext: Remove line that is a no-op
Creating the transient node will already copy the widget type. So
copying again will not do anything.
Benjamin Otte [Mon, 7 Sep 2015 12:31:26 +0000 (14:31 +0200)]
bitmask: Fix broken invert_range() implementation
The speed-up in
7da1f8a1ce145f48b6299fd8be86a64389ff0b0d was wrong in
certain conditions, even though it didn't trigger the existing
testsuite.
New testcase /bitmask/invert_range_hardcoded included.
Matthias Clasen [Mon, 7 Sep 2015 07:18:04 +0000 (03:18 -0400)]
Avoid an extra type check in gdk_screen_get_default
Just go through the vfunc directly.
Matthias Clasen [Sun, 6 Sep 2015 23:58:03 +0000 (19:58 -0400)]
Move GtkWidgetPrivate to gtkwidgetprivate.h
This lets us use inlined getters for members in there,
avoiding the type checks in the public getters.
Matthias Clasen [Mon, 7 Sep 2015 05:55:16 +0000 (01:55 -0400)]
Speed up gtk_allocated_bit_mask_invert_range
It was showing up on profiles and has a comment asking for speed.
Matthias Clasen [Sun, 6 Sep 2015 23:16:43 +0000 (19:16 -0400)]
Plug a leak
A type class reference gotten with g_type_class_ref must be released
with g_type_class_unref, or else we leak.
Matthias Clasen [Sun, 6 Sep 2015 20:10:48 +0000 (16:10 -0400)]
menu button: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 20:10:31 +0000 (16:10 -0400)]
container: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 19:58:00 +0000 (15:58 -0400)]
frame: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 19:43:01 +0000 (15:43 -0400)]
menu item: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 19:38:14 +0000 (15:38 -0400)]
text buffer: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 19:31:37 +0000 (15:31 -0400)]
text cell renderer: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 19:04:19 +0000 (15:04 -0400)]
builder: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 19:02:34 +0000 (15:02 -0400)]
gdk window: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 19:01:06 +0000 (15:01 -0400)]
device: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 16:35:12 +0000 (12:35 -0400)]
tree view column: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 14:46:38 +0000 (10:46 -0400)]
gesture single: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 14:46:15 +0000 (10:46 -0400)]
event controller: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 14:46:00 +0000 (10:46 -0400)]
radio button: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 14:45:33 +0000 (10:45 -0400)]
toggle button: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 14:45:03 +0000 (10:45 -0400)]
style context: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.
Matthias Clasen [Sun, 6 Sep 2015 14:44:30 +0000 (10:44 -0400)]
treeview: Convert to g_object_notify_by_pspec
This avoids pspec lookup overhead in g_object_notify.